{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style type="text/css">
  #des, #des input {
    width: 40px;
    text-align: center;
  }
  #id {
    width: 78px;
  }
  .bs-checkbox {
    width: 36px;
    height: 40px
  }
  .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
    margin-left: 0px;
    margin-top: 0px
  }
  #title span {
    float: right;
    margin-left: 3.333px;
  }
  .search {
    margin-bottom: 0px !important;
  }
  .asdlkjasd {
    background: #1ab394;
    color: #fff
  }
  #title {
    position: relative;
    padding-right: 50px;
  }
  #title span {
    position: absolute;
    top: 12px;
    right: 10px;
  }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
  <div class="ibox float-e-margins">
    {include file="public/tophead"}
    {include file="public/top" /}
    <div class="ibox-content">
      {include file="public/topsection"}
      <div class="row row-lg">
        <div class="col-sm-12">
          <div class="fixed-table-toolbar">
            <form  method="get" action="">
              <div class="pull-left search">
                <div class="pull-right search">
                  <button style="border-radius:0px; border:1px solid #e5e6e7;" class="btn btn-default btn-outline" type="submit">刷新</button>
                </div>
              </div>
            </form>
          </div>

          <div style="display:block;clear: both;"></div>

          <div class="example">
            <form class="form-horizontal" method="post">
              <table data-toggle="table">
                <thead>
                <tr>
                  <th>序号</th>
                  <th>用户</th>
                  <th>上月团队总收益</th>
                  <th>上月预估奖励</th>
                  <th>团队成员更新时间</th>
                  <th>成员数据更新时间</th>
                  <th>上次发奖数额</th>
                  <th>上次发奖时间</th>
                </tr>
                </thead>
                <tbody id="form">
                {volist name="data" id="v"}
                <tr id="id{$v.id}" class="class">
                  <td>{$key + 1}</td>
                  <td>
                    <a onclick="member('{$v.user_id}')" style="color:#40BCF7">{$v.user_id}</a>
                  </td>
                  <td>{$v.total_shouyi_last_month}</td>
                  <td>{$v.reward}</td>
                  <td>{:date('Y-m-d H:i', $v.team_update_time)}</td>
                  <td>{:date('Y-m-d H:i', $v.date_update_time)}</td>
                  <td>{$v.shouyi_reward}</td>
                  <td>{:date('Y-m-d H:i', $v.send_shouyi_time)}</td>
                </tr>
                {/volist}
                </tbody>
              </table>
            </form>
          </div>
        </div>
      </div>
      <hr>
      <!-- <div class="row row-lg">
       <div class="col-sm-6">
            <div  class="btn btn-outline btn-default" onclick="send()">
                确定发奖
            </div>
        </div> 
      </div> -->
    </div>
  </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
  function member(id, key = 'id')
  {
      layui.use('layer', function(){
          var layer = layui.layer;
          layer.open({
              title :'预览',
              area: ['100%', '100%'],
              type: 2,
              content: '{:url("member/index")}?search='+key+'&name='+id
          });
      });
  }
  function watch(content) {
    layui.use('layer', function(){
      var layer = layui.layer;
      layer.open({
          title :'预览',
          area: ['100%', '100%'],
          type: 1,
          content: content
        });
    });
  }
  function send() {
    let url = "{:url('ActiveReward')}"
    swal({
        title: "您确定要执行此操作吗",
        text: "操作后将无法恢复，请谨慎操作！",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "确定",
        cancelButtonText: "取消",
    },
    function(isConfirm) {
        if (isConfirm) {
            var index = layer.load(1, {
             shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            ajaxFun("post",url,{},'json',function(ret){
                if(ret){
                    if(ret.ret){
                      setTimeout(()=>{
                        swal_msg(ret.ret,'','success',1)
                      }, 100)
                    }else{
                        layer.alert(ret.err)
                    }
                }else{
                    swal_msg("错误",ret,"error");
                }
                layer.close(index); 
            })
        }
    })
  }
</script>
